1. Field of Invention
The present invention relates to a computer basic input/output system (BIOS), in particular, to a method and an apparatus for preventing a BIOS from failing to enter a boot program.
2. Related Art
A basic input/output system (BIOS) is the most basic software program code loaded into a computer hardware system. The main function of the BIOS includes: performing a power on self test (POST), i.e., checking whether a central processing unit (CPU) and controllers are in a normal status; initializing the memory, mainboard chipset, display adapter, and peripheral devices; recording setting values of the system, i.e., providing basic settings for the display, keyboard, processor, memory, and other system components; providing a routine library, i.e., providing interrupt routines called by the operating system or the application program; loading the operating system, i.e., loading the operating system from the memory to a random access memory (RAM); and the like.
With the above basic functions, the BIOS can be regarded as a mini operating system in communication with the hardware, and it is generally written in an assembly language compatible with the CPU. As the BIOS is a mini operating system program executed first after the computer is powered on, the normal operation thereof is the way to the normal operation of the computer. The BIOS includes two main components, namely, a boot block and a main BIOS. FIG. 1 is a flow chart of a BIOS boot program, including the following steps.
In Step 102, the computer is powered on.
In Step 104, the CPU sends a first instruction pointing to an address of the boot block.
In Step 106, the chipset is initialized.
In Step 108, fundamental components are initialized.
In Step 110, the memory is initialized.
In Step 112, the BIOS checksum is checked, and the main BIOS is decompressed.
In Step 114, a POST (Power on self test) is performed.
In Step 116, it is determined whether a “Delete” key is input, and if yes, Step 118 is performed; otherwise, Step 122 is performed.
In Step 118, a complementary metal-oxide-semiconductor (CMOS) setting module is decompressed.
In Step 120, CMOS setting is performed.
In Step 122, the control right is transferred to the operating system.
The boot block is a specific region in the BIOS, which is non-compressed and stored in a fixed address space, and is the first part to be executed when the computer is booted. The boot block is mainly responsible for performing the most basic and simplest initialization on the computer hardware, and then decompressing and sequentially executing other modules of the main BIOS. The boot block contains a minimum instruction set for booting, and the first address of the CPU pointing to the read-only memory (ROM) space that stores the BIOS program when the computer is booted is located at the boot block. Once data in the boot block is destroyed or lost, the BIOS cannot boot the computer, and the BIOS must be reset.
In actual production and applications, a problem that the computer still cannot be booted when the boot block is not destroyed may occur. At this time, it has no effect to reset the BIOS, and the computer cannot be normally booted unless the CMOS is cleared or the computer is powered off and then powered on again. However, after being used for a period of time, the same problem may randomly occur. Thereby, the users may consider that the problem is caused by the instability of the system, and become dissatisfied with the computer manufacturers.
The above-mentioned problem usually occurs to mainboards using Intel south bridge chips (for example, models ICH6, ICH7, ICH8, ICH9, and ICH10), and is reflected in the BIOS by a change in the first BIOS ROM space address read by the CPU. The address originally points to the boot block, but actually points to another block (generally a neighboring block at a lower level). As the other block does not contain programs necessary for booting, the computer cannot be booted.
Such an error in the BIOS execution address of the first instruction after the CPU is powered on is generally caused by an abnormality in a certain register of the south bridge (which is a top swap bit (TSB) in the register by taking an Intel chip as an example). Generally, three methods are provided for resolving the error. 1. If the register is powered by a voltage (for example, VCC3) generated when the computer is powered on, the value of the register is usually automatically restored after the computer is powered off, and may not affect the next boot operation. 2. If the register is powered by a standby voltage (for example, 3VSB), and an error occurs in the value of the register, the computer cannot be booted unless the power supply is unplugged. 3. If the register is powered by a battery on the mainboard, and an error occurs in the value of the TSB register, the computer cannot be booted unless the battery is removed or the CMOS data is cleared by a jumper.
The reason 1 basically has no effect on the boot process, while the reasons 2 and 3 may seriously affect the use of the computer. It is found in actual production that as an abnormality randomly occurs to a register of the south bridge on the mainboard, an error may occur in the execution address of the first instruction after the CPU is powered on, resulting in that the BIOS cannot boot the computer. In this case, default settings of the register of the south bridge must be restored by removing the CMOS battery or powering off and then powering on the computer, which is rather inconvenient for the users.
Therefore, the problem that the BIOS cannot boot the computer due to an error in the execution address of the first instruction after the CPU is powered on needs to be solved, so as to avoid customer complaints and user dissatisfaction.